<template>
    <div class="Son">
        <p>我是Son组件(孙),{{car.name}}-{{car.price}}</p>
    </div>
</template>

<script>
import { inject } from 'vue'
export default {
    name: 'Son',
    components: {},
    setup(){
        let car = inject('car')
        return{car}
    }
}
</script>

<style>
.Son{
    background-color: orange;
    padding: 10px;
}
</style>